<div class="block">
	<div class="block_header">Informace o projektu</div>
	<table>
		<tr><td>Název:</td><td>{$project[name]}</td></tr>
		<tr><td>Deadline:</td><td>{if $project[deadline]!=0}{$project[deadline]|date:"j.n.Y"} ({!$project[deadline]|remaining_days}){else}<em>Nezadáno</em>{/if}</td></tr>
		<tr><td>Počet milníků:</td><td>{$project->milestone()->count()}</td></tr>
		<tr><td>Počet úkolů:</td><td>{$project->task()->count()}</td></tr>
	</table>
</div>
{var $displayBlock = false}
{if}
<div class="block">
	<div class="block_header">Akce projektu</div>
	<ul>
		<li n:if="$user->isAllowed('project','add') || $user->isAllowed($projectResource,'project_add')">{var $displayBlock = true}<a href="{link addProject, $project[id]}">Vytvořit podprojekt</a></li>
		<li n:if="$user->isAllowed('project','edit') || $user->isAllowed($projectResource,'project_edit')">{var $displayBlock = true}<a href="{link addMilestone, $project[id]}">Vytvořit milník</a></li>
		<li n:if="$user->isAllowed('task','add') || $user->isAllowed($projectResource,'task_add')">{var $displayBlock = true}<a href="{link addTask, $project[id]}">Přidat úkol</a></li>
		<li n:if="$user->isAllowed('files','add') || $user->isAllowed('files','edit') || $user->isAllowed($projectResource,'files_add') || $user->isAllowed($projectResource,'task_edit')">{var $displayBlock = true}<a href="{link addFile, $project[id]}">Přidat soubor</a></li>
	</ul>
</div>
{/if $displayBlock}
<div class="block">
	<div class="block_header">Strom projektu</div>
	<div n:tag-if="$project[project_id]!=null" class="tree_parent">
		<a href="{link overview, $project->project[id]}">{$project->project[name]}</a>
		<div class="tree_this"><a href="{link overview, $project[id]}">{$project[name]}</a>
			{foreach $children as $child}
			<div class="tree_child"><a href="{link overview, $child[id]}">{$child[name]}</a></div>
			{/foreach}
		</div>
	</div>
</div>
<div class="block">
	<div class="block_header">Projektový tým</div>
		{foreach $team as $member}
	<div class="team_member">{$member->user[name]} {$member->user[surname]} - {$member->project_role[name]}</div>
		{/foreach}
</div>